package visitor


type tMockSaleOrderService struct {
	orders map[int]*SaleOrder
}

func newMockSaleOrderService() ISaleOrderService {
	return &tMockSaleOrderService{
		orders: make(map[int]*SaleOrder, 0),
	}
}

func (me *tMockSaleOrderService) Save(it *SaleOrder) error {
	me.orders[it.ID] = it
	return nil
}

func (me *tMockSaleOrderService) Visit(visitor ISaleOrderVisitor) {
	for _,v := range me.orders {
		visitor.Visit(v)
	}
}

var MockSaleOrderService = newMockSaleOrderService()